  // 团购列表
  function tuan() {
      // mockdata
      let mockData = Mock.mock({
          "shop_name": "@ctitle(3, 6)",
          "time|1000-86400": 1,
          "list|5-10": [{
              'img': "@image('528x684',#eac7ce)",
              'sellprice|100-200.2': 239.00,
              "title": "@ctitle(5, 10)",
              "join_count|2-8": 5
          }]

      });
      //   实例化vue
      new Vue({
          el: "#tuan",
          data() {
              return {
                  list: [],
                  shop_name: "",
                  time: null,
                  hour: null, //距结束剩余的小时
                  minute: null, //距结束剩余的分钟
                  second: null //距结束剩余的秒数
              }
          },
          methods: {
              // 获得店铺列表
              getList: function() {
                  let miaosUrl = `${urlParam.domain()}api/groupPurchasingActivity/activityProductList`;
                  axios({
                      url: miaosUrl,
                      method: "post",
                      params: {
                          activityId: "245",
                      }
                  }).then(res => {
                      console.log(111, res.data.data)
                      this.list = res.data.data;
                  })
                  this.shop_name = mockData.shop_name;
                  this.time = mockData.time;

              },
              //   跳转页面
              link: function(productId) {
                  window.location.href = `../../html/product/product.html?productId=${productId}`;
              },
              //将剩余秒数转换为天 时 分 秒格式
              exchangeTimeLeave: function() {
                  var time = this.time;
                  this.second = time % 60;
                  this.minute = parseInt(time / 60 % 60);
                  this.hour = parseInt(time / 3600 % 24);
              },
              //倒计时
              countdown: function() {
                  var that = this;
                  setInterval(function() {
                      that.time--;
                      //console.log(that.time);
                      that.exchangeTimeLeave();
                  }, 1000)
              }

          },
          created() {
              this.getList();
              this.exchangeTimeLeave();
              this.countdown();
          }
      })
  }

  // 秒杀列表
  function miaos() {
      // mockdata
      //status: 0=已秒完，1=抢购中
      let mockData = Mock.mock({
          "shop_name": "@ctitle(3, 6)",
          "list|5-10": [{
              'img': "@image('528x684',#eac7ce)",
              'sellprice|100-200.2': 239.00,
              "title": "@ctitle(5, 10)",
              "join_count|2-8": 5,
              "status|0-1": 1
          }]

      });
      //   实例化vue
      new Vue({
          el: "#miaos",
          data() {
              return {
                  list: [],
              }
          },
          methods: {
              // 获得店铺商品列表
              getList: function() {
                  let miaosUrl = `${urlParam.domain()}api/spikeActivity/activityProductList`;
                  axios({
                      url: miaosUrl,
                      method: "post",
                      params: {
                          activityId: "1",
                      }
                  }).then(res => {
                      console.log(111, res.data.data)
                      this.list = res.data.data;
                  })
                  this.shop_name = mockData.shop_name;

              },
              //   跳转页面
              link: function(productId) {
                  window.location.href = `../../html/product/product.html?productId=${productId}`;
              },
          },
          filters: {

          },
          created() {
              this.getList();
          }
      })
  }

  // 团购详情
  function tuan_detail() {
      // mockdata
      //status: 1=参团成功，2=拼团成功，3=拼团失败，4=等待成团
      let mockData = Mock.mock({
          "status": 3,
          "leave_count|2-8": 5,
          "product": {
              'img': "@image('360x360',#eac7ce)",
              "title": "@ctitle(20, 30)",
              "join_count|2-8": 5,
              "sell_count|1500-2000": 1500,
              'sellprice|100-200.2': 239.00,
              'savedprice|10-60': 40,
          },
          'members|2': ["@image('135x135',#eac7ce)"]
      });
      //   实例化vue
      new Vue({
          el: "#tuan_detail",
          data() {
              return {
                  product: null,
                  members: []
              }
          },
          methods: {
              // 获得店铺列表
              getList: function() {
                  this.members = mockData.members;
                  this.product = mockData.product;
                  this.leave_count = mockData.leave_count;
                  this.status = mockData.status;
              }
          },
          created() {
              this.getList();
          }
      })
  }

  // 参团成员
  function tuan_member() {
      // mockdata
      let mockData = Mock.mock({
          "product": {
              'img': "@image('360x360',#eac7ce)",
              "title": "@ctitle(20, 30)",
              "join_count|2-8": 5,
              "sell_count|1500-2000": 1500,
              'sellprice|100-200.2': 239.00,
              'savedprice|10-60': 40,
          },
          'members|8': ["@image('135x135',#eac7ce)"]
      });
      //   实例化vue
      new Vue({
          el: "#tuan_member",
          data() {
              return {
                  product: null,
                  members: []
              }
          },
          methods: {
              // 获得店铺列表
              getList: function() {
                  this.members = mockData.members;
                  this.product = mockData.product;
                  this.leave_count = mockData.leave_count;
                  this.status = mockData.status;
              }
          },
          created() {
              this.getList();
          }
      })
  }